﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.WebTesting;

namespace Inventory.Test.AhmedTests
{
    public class CustomExtractionRule : ExtractionRule
    {
        public override void Extract(object sender, ExtractionEventArgs e)
        {

            if (!(e.Response.IsHtml))
            {

                e.Success = false;

                e.Message = "The response did not contain HTML.";

                return;

            }



            string clientID = "";// Convert.ToString(e.WebTest.Context[ContextKey.ClientID]);



            foreach (QueryStringParameter param in e.Request.QueryStringParameters)
            {

                if (param.Name == "clientID")
                {

                    param.Value = clientID;

                }

            }

            e.Success = true;

        }
    }
}
